Coverage Report

Created: 2021-08-28 18:14

D:\git\skunkworks\herald-for-cpp\herald\src\datatype\rssi.cpp
Line
Count
Source (jump to first uncovered line)
1
//  Copyright 2020-2021 Herald Project Contributors
2
//  SPDX-License-Identifier: Apache-2.0
3
//
4
5
#include "herald/datatype/rssi.h"
6
7
#include <string>
8
9
namespace herald {
10
namespace datatype {
11
12
// class RSSI::Impl {
13
// public:
14
//   Impl();
15
//   ~Impl() = default;
16
17
//   int value;
18
// };
19
20
// RSSI::Impl::Impl() : value(0) { }
21
22
RSSI::RSSI()
23
 : value(0)
24
424
{
25
424
  ;
26
424
}
27
28
RSSI::RSSI(int value)
29
 : value(value)
30
351
{
31
351
  ;
32
351
}
33
34
RSSI::RSSI(const RSSI& other)
35
 : value(other.value)
36
846
{
37
846
  ;
38
846
}
39
40
RSSI::RSSI(RSSI&& other)
41
 : value(other.value)
42
102
{
43
102
  ;
44
102
}
45
46
1.72k
RSSI::~RSSI() {}
47
48
RSSI&
49
RSSI::operator=(const RSSI& other)
50
39
{
51
39
  value = other.value;
52
39
  return *this;
53
39
}
54
55
RSSI&
56
RSSI::operator=(RSSI&& other)
57
200
{
58
200
  value = other.value;
59
200
  return *this;
60
200
}
61
62
std::size_t
63
0
RSSI::hashCode() const noexcept {
64
0
  return std::hash<int>{}(value);
65
0
}
66
67
0
RSSI::operator std::string() const noexcept {
68
0
  return "RSSI{value=" + std::to_string(value) + "}";
69
0
}
70
71
int
72
22
RSSI::intValue() const noexcept {
73
22
  return value;
74
22
}
75
76
0
RSSI::operator long() const noexcept {
77
0
  return value;
78
0
}
79
80
775
RSSI::operator double() const noexcept {
81
775
  return (double)value;
82
775
}
83
84
85
86
bool
87
RSSI::operator==(const int other) const noexcept
88
84
{
89
84
  return value == other;
90
84
}
91
92
bool
93
RSSI::operator!=(const int other) const noexcept
94
0
{
95
0
  return value != other;
96
0
}
97
98
bool
99
RSSI::operator==(const RSSI& other) const noexcept
100
3
{
101
3
  return value == other.value;
102
3
}
103
104
bool
105
RSSI::operator!=(const RSSI& other) const noexcept
106
0
{
107
0
  return value != other.value;
108
0
}
109
110
bool
111
RSSI::operator<(const RSSI& other) const noexcept
112
0
{
113
0
  return value < other.value;
114
0
}
115
116
bool
117
RSSI::operator<=(const RSSI& other) const noexcept
118
0
{
119
0
  return value <= other.value;
120
0
}
121
122
bool
123
RSSI::operator>(const RSSI& other) const noexcept
124
0
{
125
0
  return value > other.value;
126
0
}
127
128
bool
129
RSSI::operator>=(const RSSI& other) const noexcept
130
0
{
131
0
  return value >= other.value;
132
0
}
133
134
135
136
137
138
} // end namespace
139
} // end namespace